<?
//设置需要搜索的表格的前缀后缀
$table_suffix = 'term';
$table        = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀
?>


<?

$trans_nid = addslashes($_REQUEST ['nid']);
$result = mysql_query("SELECT * FROM $table where nid = '$trans_nid'");

while($row = mysql_fetch_array($result))
  {
  $term_info = $row;
  $term_nid=$row['nid'];
  $term_mid=$row['mid'];
  $term_name=$row['name'];
  $term_en_name=$row['en_name'];
  $term_search_name=$row['search_name'];
  $term_title=$row['title'];
  $term_keyword=$row['keyword'];
  $term_url=$row['url'];
  $term_description=$row['description'];
  $term_model=$row['model'];
  $term_introduce=$row['introduce'];
  $term_detail=$row['detail'];
  $term_stock=$row['stock'];
  $term_price=$row['price'];
  $term_memberprice=$row['memberprice'];
  $term_discountprice=$row['discountprice'];
  $term_local=$row['local'];
  $term_listorder=$row['listorder'];
  $term_hotsale=$row['hotsale'];
  $term_discount=$row['discount'];
  $term_recommend=$row['recommend'];
  $term_soldout=$row['soldout'];
  $term_publish=$row['publish'];
  $term_clickrate=$row['clickrate'];
  $term_onsaletime=$row['onsaletime'];
  $term_modifytime=$row['modifytime'];

  $term_icon=$row['icon'];
  $term_term_banner=$row['term_banner'];

  $term_link=$row['link'];
  $term_mark=$row['mark'];
  $term_markorder=$row['markorder'];
  $term_term_extend_img=$row['extend_img'];

  $term_vip=$row['vip_term'];

    $term_term1=$row['term1'];
	$term_term2=$row['term2'];
	$term_term3=$row['term3'];
	$term_term4=$row['term4'];
	$term_term5=$row['term5'];

	$term_interm=$row['interm'];
	$term_is_disabled=$row['is_disabled'];


  }


$query = mysql_query("SELECT * FROM ".$table_Prefix."brand_term_relation where term_id = '$trans_nid' order by  nid asc");


$i = 0;
while($row = mysql_fetch_assoc($query))
{

   $detail_relation_list_arr[] = $row['brand_id'];

   $brand_info = select_one_line_all_items($table_Prefix . "term" , ' nid ='.$row['brand_id']);

   $detail_relation_list_json[$i]['title'] = $brand_info['name'];
   $detail_relation_list_json[$i]['value'] = $brand_info['nid'];

  $i++;
}


$detail_relation_list = implode("','",$detail_relation_list_arr);

$detail_relation_list = "'".$detail_relation_list."'";



$json_brand_list = '';

$brand_list = select_lines_all_items($table_Prefix . "term", ' nid  desc ' , " belong = 'brand' ");

	foreach($brand_list as $key=>$val){
		$new_brand_list[$key]['title'] = $val['name'];
		$new_brand_list[$key]['value'] = $val['nid'];
	}
$json_brand_list = json_encode($new_brand_list);

$detail_relation_list_json = json_encode($detail_relation_list_json);


mysql_close($con);
?>

